﻿@model PlmPersonnelWagesViewModel
@{
    Layout = null;
    ViewBag.Title = "人员工资-列表";
    decimal wages = 0;
}
<script type="text/javascript">
    $(document).ready(function () {
        $(".comsplitpage").val("@ViewBag.numPerPage");
    });
</script>
@using (Html.BeginForm("SplitPage", "PlmPersonnelWages", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return divSearch(this, 'rygz_list" + ViewBag.type + "');" }))
{
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <ul class="searchBar">
        <li>
            <input type="hidden" name="input_section" value="@(ViewBag.Section)" />
            <input type="hidden" name="input_type" value="@(ViewBag.type)" />
            <span>选择时间：</span>
            <input type="text" name="time" class="date"  value="@(ViewBag.time)" format="yyyy-MM" />
        </li>
        <li><span>姓名：</span>
            <input type="text" name="name" value="@(ViewBag.name)" />
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
   
}
<div class="panelBar" style="border-top:none;">
    <ul class="toolBar">
        @if (ViewBag.type == "1")
        {
             
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Detail1", "PersonnelLog_PlmPersonnelWages_PersonnelWagesDetail1",
                    Url.Action("PersonnelWagesDetail", "PlmPersonnelWages", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_tzsb_detail"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","320"},{"warn","请选择一条信息!"}
                    })
            </li>
            <li class="line">line</li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Download1", "PersonnelLog_PlmPersonnelWages_Download1",
                      "../../Areas/PersonnelLog/Upload/人员工资模板.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","模板下载"}
                    })
            </li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Input1", "PersonnelLog_PlmPersonnelWages_Input1",
                    Url.Action("IndexAttendance", "Import", new { url = "/PlmPersonnelWages/ImportExcelFile", Section = ViewBag.Section }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_tzsb_input"} ,{"lookupgroup","attachment"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
            </li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Export1", "PersonnelLog_PlmPersonnelWages_Export1",
                      Url.Action("Excel", "PlmPersonnelWages", new { Section = ViewBag.Section, Date =ViewBag.time }),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
            </li>
        }
        @if (ViewBag.type == "2")
        {
             
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Detail2", "PersonnelLog_PlmPersonnelWages_PersonnelWagesDetail2",
                    Url.Action("PersonnelWagesDetail", "PlmPersonnelWages", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_tzsb_detail"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","320"},{"warn","请选择一条信息!"}
                    })
            </li>
            <li class="line">line</li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Download2", "PersonnelLog_PlmPersonnelWages_Download2",
                      "../../Areas/PersonnelLog/Upload/人员工资模板.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","模板下载"}
                    })
            </li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Input2", "PersonnelLog_PlmPersonnelWages_Input2",
                    Url.Action("IndexAttendance", "Import", new { url = "/PlmPersonnelWages/ImportExcelFile", Section = ViewBag.Section }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_tzsb_input"} ,{"lookupgroup","attachment"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
            </li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Export2", "PersonnelLog_PlmPersonnelWages_Export2",
                     Url.Action("Excel", "PlmPersonnelWages", new { Section = ViewBag.Section, Date = ViewBag.time }),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
            </li>
        }
        @if (ViewBag.type == "3")
        {
             
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Detail3", "PersonnelLog_PlmPersonnelWages_PersonnelWagesDetail3",
                    Url.Action("PersonnelWagesDetail", "PlmPersonnelWages", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_tzsb_detail"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","320"},{"warn","请选择一条信息!"}
                    })
            </li>
            <li class="line">line</li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Download3", "PersonnelLog_PlmPersonnelWages_Download3",
                      "../../Areas/PersonnelLog/Upload/人员工资模板.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","模板下载"}
                    })
            </li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Input3", "PersonnelLog_PlmPersonnelWages_Input3",
                    Url.Action("IndexAttendance", "Import", new { url = "/PlmPersonnelWages/ImportExcelFile", Section = ViewBag.Section }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_tzsb_input"} ,{"lookupgroup","attachment"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
            </li>
            <li>
                @Html.PermissionButton("PersonnelLog.PlmPersonnelWages.Export3", "PersonnelLog_PlmPersonnelWages_Export3",
                     Url.Action("Excel", "PlmPersonnelWages", new { Section = ViewBag.Section, Date = ViewBag.time }),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
            </li>
        }
    </ul>
</div>
<table class="table" width="100%" layouth="122" nowraptd="false" rel="rygz_list@(ViewBag.type)">
    <thead>
        <tr>
            <th width="30" align="center">
                序号
            </th>
            <th width="50" align="center">
                工号
            </th>
            <th width="90" align="center">
                姓名
            </th>
            <th width="80" align="center">
                出勤天数
            </th>
            <th width="80" align="center">
                本月工资
            </th>
            <th width="80" align="center">
                备注
            </th>
        </tr>
    </thead>
    <tbody>
        @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
        @foreach (var item in Model.PlmPersonnelWagesList)
        {
            num += 1;
            <tr target="ids" rel="@item.PW_ID" >
                <td align="center">@num
                </td>
                <td align="center">@item.PW_JobNum
                </td>
                <td align="center">
                    <a style="color:#000;" href="@Url.Action("PersonnelWagesDetail", "PlmPersonnelWages", new { id = item.PW_ID })" rel="tzgl_tzsb_detail" mask="true" target="dialog" width="480" height="320">@item.PW_PersonnelName</a>
                </td>
                <td align="center">@item.PW_AttendanceDay
                </td>
                <td align="center">@item.PW_Wages
                </td>
                <td align="center">@item.PW_Remark
                </td>
            </tr>
                              wages += item.PW_Wages;
        }
        @{if (Model.PlmPersonnelWagesList.Count > 0)
          {
            <tr>
                <td rowspan="2" colspan="2">
                    本月工资合计：
                </td>
                <td>
                </td>
                <td>
                </td>
                <td align="center">@wages
                </td>
                <td>
                </td>
            </tr> 
          }
           
        }
    </tbody>
</table>
<div class="panelBar" style="border-bottom:none;">
    <div class="pages" style="float: right">
        <span>显示</span>
        <select class="comsplitpage" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value}, 'rygz_list@(ViewBag.type)')">
            <option value="10">10</option>
            <option selected="selected" value="20">20</option>
            <option value="50">50</option>
        </select>
        <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
    </div>
    <div class="pagination" style="margin:0px;float:left; margin-left:35%" rel="rygz_list@(ViewBag.type)" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
    </div>
</div>
